package com.jie.common.enums;

import lombok.Getter;

/**
 * @author jie
 * @version 1.0 2025-02-16
 */
@Getter
public enum RuleTimeUnit {
    /**
     * 规则时间单位
     * */
    SECOND(1,"秒"),
    MINUTE(2,"分钟")
    ;

    private final Integer code;

    private final String msg;

    RuleTimeUnit(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static RuleTimeUnit getRc(Integer code) {
        for (RuleTimeUnit re : RuleTimeUnit.values()) {
            if (re.code.intValue() == code.intValue()) {
                return re;
            }
        }
        return null;
    }
}
